<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require dirname(__FILE__).'/pc_controller.php';

require_once dirname(__FILE__).'/menu.php';

class Bluemember_card_history extends PC_controller {

    public function __construct(){
        parent::__construct();
        $this->load->model('Bluemembercustomermodel','m_customer');
    }

    public function index(){
        $data = parent::index();

        global $g_bluemember_gift,$g_cardlist;
        $data['game_gift'] = array4js($g_bluemember_gift);
        $card_list = array();
        foreach ($g_cardlist as $key => $value) {
            $card_list[] = array($key,$value['CardName']);
        }
        $data['card_list'] = json_encode($card_list);

        $this->load->view('admin/bluemember_card_history',$data);
    }

    public function getCardHistoryList() {
        $assist['where'] = getFilter($this->input->post(),Bluemembercustomermodel::$historySearchField);
        $assist['like'] = getFilter($this->input->post(),Bluemembercustomermodel::$historyLikeField);
        $assist['pagination'] = getPagination($this->input->post());

        $assist['select'] = '
            bluemember_customer.customer_id,
            bluemember_customer.bluemember_user_id,
            bluemember_customer.bluemember_phone,
            bluemember_card_history.*
        ';
        list($list,$count) = $this->m_customer->getCardHistoryListSection($assist);

        $this->response->setSuccess();
        $this->response->setItems($list);
        $this->response->setTotalCount($count);
        $this->response->responseExit();
    }

}
/* End of file aa_game_history.php */
/* Location: ./application/controllers/aa_game_history.php */